// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue';
import App from './App';
import router from './router';
import VueResource from 'vue-resource';
import axios from 'axios';
// import {ajax} from 'common/js/base';

// 基础stylus
import './common/stylus/base.styl';

// 引用layer
import '../static/js/lib/layer_mobile/need/layer.css';
import layer from '../static/js/lib/layer_mobile/layer';

// 引入控制器入口函数
// import checkToken from './controller';

Vue.config.productionTip = false;

// 使用vue-resource
Vue.use(VueResource);

Vue.prototype.$layer = layer;
Vue.prototype.$axios = axios;
Vue.prototype.$android = 'http://cms.2qb.com/Public/android/God_Release.apk';

router.beforeEach((to, from, next) => {
  // 标题
  document.title = to.meta.title;
  next();
});

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router: router,
  template: '<App/>',
  components: { App }
});
